from flask_learn.ORM增删改查 import models
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine

engine = create_engine("mysql+pymysql://root:qaz3357375@127.0.0.1:3306/test?charset=utf8", max_overflow=5)
Session = sessionmaker(bind=engine)
session = Session()

# 删除
session.query(models.Classes).filter(models.Classes.id > 2).delete()

session.commit()
session.close()
